package com.san.hkhospital.controller;
import com.san.hkhospital.entity.Type;
import com.san.hkhospital.service.TypeService;
import com.san.hkhospital.service.impl.TypeServiceImpl;
import com.san.hkhospital.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
* (type)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/type")
public class TypeController {
/**
* 服务对象
*/
@Resource
private TypeServiceImpl typeServiceImpl;
    @Autowired
    private TypeService typeService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public Type selectOne(Integer id) {
return typeServiceImpl.selectByPrimaryKey(id);
}

    @GetMapping("typeOptions")
    public ResultVO payinType() {
        return ResultVO.success("所有收入查看成功", typeService.payinType());
    }
    
    @GetMapping("typeOption")
    public ResultVO payoutType() {
        return ResultVO.success("所有支出查看成功", typeService.payoutType());
    }


  @GetMapping("typeList")
  public ResultVO typeList(){
    return ResultVO.success("账户角色添加成功",typeService.typeList());
  }



    @GetMapping("MedicineTypeList")
    public ResultVO MedicineTypeList() {
        List<Type> types = typeService.medicineType();
        return ResultVO.success("药品类型获取成功", types);
    }
}





